package producatorconsumator;

public class Consumator extends Thread {
	BlockMyStack bms;
	String name;

	Consumator(BlockMyStack bms, String s) {
		this.bms = bms;
		this.name = s;

	}

	public void run() {

		try {

			for (int i = 1; i < 6; i++, Thread.sleep(1000)) {

				bms.pop();
				System.out.println(name + " Consumed Request "
						+ bms.getStackValue());
			}
		} catch (InterruptedException e) {

			e.printStackTrace();
		}

	}
}
